package crawler.itf;


import crawler.common.PostData;
import java.util.List;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;


public class PostImpl implements PostParserItf{

    @Override
    public String getSite(Document doc) {
        return "";
    }

    @Override
    public List<PostData> getListTitle(Document doc) {
        return null;
    }

    @Override
    public String getThumb(Document doc) {
        return "";
    }

    @Override
    public String getUrl(Document doc) {
        return "";
    }

    @Override
    public PostData getDetail(Document doc) {
        return null;
    }

    @Override
    public String getCat(Document doc) {
        return "";
    }

    @Override
    public String getTitle(Document doc) {
        return "";
    }

    @Override
    public String getDesc(Document doc) {
        return "";
    }

    @Override
    public String getContent(Document doc) {
        return "";
    }

    @Override
    public String getJournalist(Document doc) {
        return "";
    }

    @Override
    public long getPublished(Document doc) {
        return 0;
    }

    @Override
    public List<String> getTags(Document doc) {
        return null;
    }

    @Override
    public String getFbUrl(Document doc) {
        Element fbUrl = doc.head().select("meta[property=og:url]").first();
        if(null == fbUrl) return "";
        String url = fbUrl.attr("content");
        return url;
    }

    @Override
    public String getFbTitle(Document doc) {
        Element fbTitle = doc.head().select("meta[property=og:title]").first();
        if(null == fbTitle) return "";
        String title = fbTitle.attr("content");
        return title;
    }

    @Override
    public String getFbThumb(Document doc) {
        Element thumb = doc.head().select("meta[property=og:image]").first();
        if(null == thumb) return "";
        String th = thumb.attr("content");
        return th;
    }
    @Override
    public String getFbDesc(Document doc) {
        Element thumb = doc.head().select("meta[property=og:description]").first();
        if(null == thumb) return "";
        String th = thumb.attr("content");
        return th;
    }
    @Override
    public String getFbSite(Document doc) {
        Element thumb = doc.head().select("meta[property=og:site_name]").first();
        if(null == thumb) return "";
        String th = thumb.attr("content");
        return th;
    }

}
